<template>
    <div>
    <h2>显示列表</h2>
    <table>
        <tr>
            <td>编号</td>
            <td>账号</td>
            <td>密码</td>
            <td>时间</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in list" >
            <td>{{ item.lid }}</td>
            <td>{{ item.lname }}</td>
            <td>{{ item.lpwd }}</td>
            <td>{{ item.ldate }}</td>
            <td>
                <input type="button" value="删除">
            </td>
        </tr>
    </table>
    </div>
</template>

<script setup lang="ts">

 import { reactive,toRefs, onMounted} from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import axios from 'axios'
 const route = useRoute()
 const router = useRouter()

 const data:any = reactive({
    list:[]
 })

 const {list} = toRefs(data)

 onMounted(()=>{
    funshow()
 })

const funshow = ()=>{
    axios({
        url:'https://localhost:7144/api/Login/funshow',
        method:'get',
    })
    .then((res)=>{
        console.log(res)
        list.value = res.data.data
    })
    .catch((err)=>{
        console.log(err)
    })
}

</script>

<style scoped>

</style>